local wangliec = fk.CreateSkill{
  name = "mod__wangliec",
}
local wangliec_ = {
  name = "mod__wangliec",
  events = {fk.CardUsing},
  can_trigger = function(self, event, target, player, data)
    return target == player and player.phase == Player.Play and player:hasSkill(self) and
      (data.card:isCommonTrick() or data.card.trueName == "slash")
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askForSkillInvoke(player, self.name, nil, "#mod__wangliec-invoke:::"..data.card:toLogString())
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = data.disresponsiveList or {}
    for _, p in ipairs(player.room.alive_players) do
      table.insertIfNeed(data.disresponsiveList, p.id)
    end
    player.room:addPlayerMark(player, "@mod__wangliec-phase", 1)
    player.room:addPlayerMark(player, "mod__wangliec2-turn", 1)
  end,

  refresh_events = {fk.AfterCardUseDeclared},
  can_refresh = function(self, event, target, player, data)
    return target == player and player.phase == Player.Play
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "wanglie-phase", 1)
  end,
}
local wanglie_targetmod = {
  bypass_distances =  function(self, player, skill, card, to)
    return card and player:hasSkill("mod__wangliec") and player.phase == Player.Play and player:getMark("wanglie-phase") < 2
  end,
}
local wanglie_prohibit = {
  is_prohibited = function(self, from, to)
    return from:getMark("@mod__wangliec-phase") > 0 and from ~= to
  end,
}
local wanglie_skip = {
  mute = true,
  events = {fk.EventPhaseChanging},
  can_trigger = function(self, event, target, player, data)
    if target == player and not player.dead and data.to == Player.Discard then
      return player:getMark("mod__wangliec2-turn") > 0
    end
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player:skip(Player.Discard)
    return true
  end,
}
wangliec:addEffect(fk.CardUsing, wangliec_)
wangliec:addEffect("targetmod", wanglie_targetmod)
wangliec:addEffect("prohibit", wanglie_prohibit)
wangliec:addEffect(fk.EventPhaseChanging, wanglie_skip)
return wangliec